import 'dart:convert';

import 'package:crypto/crypto.dart';

import '../resources.dart';
import '../http/HttpAddress.dart';
import '../http/Request.dart';

/// created by hcl
/// on 2024/2/24
/// UserDao 用户登录和信息方面的接口
/// desc
class UserDao {
  // ///登录
  // static Future<HttpResult> login(String stationId, String clerkId,
  //     String password, String verifyCode) async {
  //   print('ssss login:${CommonUtils.deviceIdString}');
  //   HttpResult netResult = await Request.request(HttpAddress.login, data: {
  //     'stationId': stationId,
  //     'clerkId': clerkId,
  //     'password': password,
  //     'verifyCode': verifyCode,
  //     'type': '3',
  //     'version': CommonUtils.versionString,
  //     // 'serialNo': CommonUtils.deviceIdString,
  //     // 'IMEI': CommonUtils.deviceIdString,
  //     'serialNo': md5
  //         .convert(utf8.encode(CommonUtils.deviceIdString + stationId))
  //         .toString(),
  //     'IMEI': md5
  //         .convert(utf8.encode(CommonUtils.deviceIdString + stationId))
  //         .toString(),
  //     'latitude': 0.0,
  //     'longitude': 0.0,
  //   });
  //   return netResult;
  // }
  //
  // ///{"access_token":"MWM1MWRiOTgyYWQxNDhmNmFhMTBhYzJiMDYyYWRlYWM","app_key":"cbecc90598c645348c82366a2052f34f",
  // ///"param_json":"{\"IMEI\":\"dfde7c1999a7b4ad2bec\",\"clerkId\":\"0\",\"latitude\":0.0,\"longitude\":0.0,\
  // ///"password\":\"ah@123456\",\"serialNo\":\"dfde7c1999a7b4ad2bec\",\"stationId\":\"37670111\",
  // ///\"type\":\"3\",\"verifyCode\":\"\",\"version\":70}","v":"1.0","format":"json",
  // ///"sign":"ca415b8ec80464b09eeecea3c951f654","sign_method":"MD5","timestamp":"2025-02-13 00:26:06"}
  //
  // ///{"app_key":"cbecc90598c645348c82366a2052f34f","format":"json",
  // ///"param_json":"{\"stationId\":\"37670111\",\"clerkId\":\"0\",\"password\":\"ah@123456\",\
  // ///"verifyCode\":\"\",\"type\":\"3\",\"version\":\"1.0.1\",\"serialNo\":\"\",
  // ///\"IMEI\":\"\",\"latitude\":0,\"longitude\":0}","sign":"4287d2af56266a6a43084bba966d573e",
  // ///"sign_method":"MD5","timestamp":"2025-02-13 00:09:56","v":"1.0"}
  // ///获取验证码-登录
  // static Future<HttpResult> loginCode(String stationId, String clerkId) async {
  //   HttpResult netResult = await Request.request(HttpAddress.loginCode,
  //       data: {'stationId': stationId, 'clerkId': clerkId});
  //   return netResult;
  // }
  //
  // ///获取验证码-绑定新手机
  // static Future<HttpResult> bindCode(String phone) async {
  //   HttpResult netResult =
  //       await Request.request(HttpAddress.bindCode, data: {'phone': phone});
  //   return netResult;
  // }
  //
  // ///校验验证码-绑定新手机
  // static Future<HttpResult> bindPhone(
  //     String stationId, String phone, String code) async {
  //   HttpResult netResult = await Request.request(HttpAddress.bindPhone, data: {
  //     'stationId': stationId,
  //     'phone': phone,
  //     'code': code,
  //     'IMEI': CommonUtils.deviceIdString,
  //     'type': '3'
  //   });
  //   return netResult;
  // }
  //
  // ///修改密码
  // static Future<HttpResult> changePassword(String old, String newPhone) async {
  //   HttpResult netResult =
  //       await Request.request(HttpAddress.changePassword, data: {
  //     'old': old,
  //     'new': newPhone,
  //   });
  //   return netResult;
  // }

  ///消息列表
  static Future<HttpResult> messageList() async {
    HttpResult netResult =
        await Request.request(HttpAddress.messageList, data: {});
    return netResult;
  }
}
